package com.rockcent.mall.lib.domain;


import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.FavoriteType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by zhangjh on 2016/10/21.
 */
@Entity
@Table(name = "favorite")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class Favorite extends IDEntityMall {
    @Column(columnDefinition = "bigint comment '客户ID'")
    private Long customerId;
    @Column(columnDefinition = "bigint comment '产品ID'")
    private Long productId;
    @Column(columnDefinition = "bigint comment '商铺ID'")
    private Long merchantId;
    @Column(columnDefinition = "varchar(255) comment '收藏类型，PRODUCT 产品,MERCHANT 商铺'")
    @Enumerated(EnumType.STRING)
    private FavoriteType type;
    @Column(columnDefinition = "bigint comment '平台ID'")
    private Long mallId;


    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public FavoriteType getType() {
        return type;
    }

    public void setType(FavoriteType type) {
        this.type = type;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    @Override
    public String toString() {
        return "Favorite{" +
                "customerId=" + customerId +
                ", productId=" + productId +
                ", id=" + id +
                ", merchantId=" + merchantId +
                ", dateCreated=" + dateCreated +
                ", type=" + type +
                ", lastUpdated=" + lastUpdated +
                ", mallId=" + mallId +
                ", isDelete=" + isDelete +
                ", version=" + version +
                '}';
    }
}
